<?php 
$templateURL = $this->basePath('public/template');
?>
     <?php
    $form = $this->ProductForm;   
    $form->prepare();
    echo $this->form()->openTag($form);
    ?>
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title">Sửa sản phẩm</h4>
      </div>
      <div class="modal-body">
         <dl class="dl-horizontal">
               <dt>
			    <?php echo $this->formLabel($form->get('producttypes')); ?>
			  </dt>
			  <dd>
			  <?php echo $this->formElement($form->get('producttypes')); ?>
			  <span class="text-danger product-error"><?php echo $this->formElementErrors($form->get('producttypes'));?></span>
			  </dd>
         
			  <dt>
			    <?php echo $this->formLabel($form->get('namepro')); ?>
			  </dt>
			  <dd>
			  <?php echo $this->formElement($form->get('namepro')); ?>
			  <span class="text-danger product-error"><?php echo $this->formElementErrors($form->get('namepro'));?></span>
			  </dd>
			  
			  <dt>
			    <?php echo $this->formLabel($form->get('contentpro')); ?> 
			  </dt>
			  <dd>
			  <?php echo $this->formElement($form->get('contentpro')); ?>
			  <span class="text-danger product-error"><?php echo $this->formElementErrors($form->get('contentpro'));?></span>
			  </dd>
			  <?php foreach ($this->imgproduct as $fdsf): ?>
			  <?php if(isset($fdsf)): ?>
			  <dd class="ezampro">
             <div id="carousel-example-generic" class="carousel slide slidepro" data-ride="carousel">			  
					
					  <!-- Wrapper for slides -->
					  <div class="carousel-inner" role="listbox">
					 
					    <?php foreach ($this->imgproduct as $key=>$val): ?>
					     <?php if($key == 0): ?>
					      <?php echo '<div class="item active sun_img" id="sun_img'.$this->escapeHtml($val->ID_IMGPR).'"><img width="870" height="300" src="/timthumb/870x300/'.$this->escapeHtml($val->LINKIMG).'"/></div>';?>
					     <?php else: echo '<div class="item sun_img" id="sun_img'.$this->escapeHtml($val->ID_IMGPR).'"><img width="870" height="300" src="/timthumb/870x300/'.$this->escapeHtml($val->LINKIMG).'"/></div>';?>
					     <?php endif ?>
					      <?php endforeach; ?>
					  </div>
					  <!-- Indicators -->
					  <ol class="carousel-indicators li-indicators">					    
					    <?php foreach ($this->imgproduct as $keypro=>$valimgproduct):?>
					    <?php if($keypro == 0): ?>
					      <?php echo '<li id="sun_img'.$this->escapeHtml($valimgproduct->ID_IMGPR).'" data-target="#carousel-example-generic" class="active sun_img" data-slide-to="'.$keypro.'"><img width="62" height="62" class="cl-img'.$this->escapeHtml($valimgproduct->ID_IMGPR).'" src="/timthumb/62x62/'.$this->escapeHtml($valimgproduct->LINKIMG).'"/>
    		               <span class="deleteimgpro" red="'.$this->escapeHtml($valimgproduct->LINKIMG).'" id="'.$this->escapeHtml($valimgproduct->ID_IMGPR).'"><i class="fa fa-times-circle"></i>
    						</span></li>';?>
					      <?php else: echo '<li id="sun_img'.$this->escapeHtml($valimgproduct->ID_IMGPR).'" data-target="#carousel-example-generic" class="sun_img" data-slide-to="'.$keypro.'"><img width="62" height="62" class="cl-img'.$this->escapeHtml($valimgproduct->ID_IMGPR).'" src="/timthumb/62x62/'.$this->escapeHtml($valimgproduct->LINKIMG).'"/>
    		              <span class="deleteimgpro" red="'.$this->escapeHtml($valimgproduct->LINKIMG).'" id="'.$this->escapeHtml($valimgproduct->ID_IMGPR).'"><i class="fa fa-times-circle"></i>
    						</span></li>';?>
					      <?php endif ?>
					      <?php endforeach; ?>
					  </ol>					 
					  </div>
			  </dd>
			  <?php endif ?>
			   <?php endforeach; ?>
			  <dt>
			    <?php echo $this->formLabel($form->get('file_uploads')); ?> 
			  </dt>			  
			  <dd class="file_uploads">			  
			  <span class="arrfileupload"><?php echo $this->formElement($form->get('file_uploads')); ?>
			   <span class="remove_file"><i class="fa fa-minus-square"></i>
			  </span>
			  </span>
			  <span class="add_file"><i class="fa fa-plus-square"></i>
			  </span>
			  <span class="text-danger product-error"><?php echo $this->formElementErrors($form->get('file_uploads'));?></span>
			  </dd>
			  
			  <dt class="activep">
			    <?php echo $this->formLabel($form->get('activepro')); ?> 
			  </dt>
			  <dd class="activep1">
			  <?php echo $this->formElement($form->get('activepro')); ?>
			  </dd>
		  </dl>
      </div>
             
      <div class="modal-footer">
        
        <?php
        echo $this->formElement($form->get('submit'));
      ?>
      </div>
    </div>
    <?php
      echo $this->form()->closeTag($form);
     ?>     
     <script type="text/javascript">
                CKEDITOR.config.allowedContent = true;
                CKEDITOR.replace('contentpro', {
                    'extraPlugins': 'showblocks,div,doksoft_backup,doksoft_stat,iframe',
                    'filebrowserImageBrowseUrl': '<?= $templateURL.'/plugin/ckeditor/plugins/imgbrowse/imgbrowse.html'?>',
                    'filebrowserImageUploadUrl': '<?= $templateURL.'/plugin/ckeditor/plugins/imgupload.php'?>',
                  });                
            </script>     